Microsoft Visual FoxPro 5.0a Release Notes Home

© 1996-1997 Microsoft Corporation

Visual FoxPro 5.0a integrates more smoothly with Visual Studio&trade 97 and Microsoft® Office 97. Many of the component pieces of Visual FoxPro are updated so that versioning is identical across the entire Visual Studio 97 product.

These release notes contain supplemental information to the Microsoft® Visual FoxPro™ documentation in Help, books, and on CD. For additional information, check the Microsoft Visual FoxPro Web site at http://www.microsoft.com/vfoxpro/.

Contents

Installation Requirements

Installing Visual FoxPro

New Features in Visual FoxPro 5.0

Using Visual FoxPro

Installation
Forms and Controls
Reports, Views, Queries, and SQL
Development Environment
Wizards
Class Browser
ActiveX Controls
Using Visual FoxPro Online Documentation

Changes to Documentation

Installation Requirements

The following sections outline the installation requirements for Visual FoxPro generally, and for individual components that you might choose to install.

Installation Requirements for Visual FoxPro

You can run Visual FoxPro with Windows® 95 or Windows NT 4.0. The Windows NT documentation outlines the minimum requirements for running Windows NT. Windows NT Server 4.0 Service Pack 2 (included in the Winnt40.qfe folder on your Visual Studio CD 2 or 4) is recommended but is not required. You can also download Service Pack 2 from http://www.microsoft.com/ntserver/ (click the Free Software button).

Following are the recommended requirements for running Visual FoxPro with Windows 95:

A VGA or higher-resolution monitor is recommended.

Requirements for the Setup Wizard

To run the Setup Wizard, you must have the Visual FoxPro Runtime installed. The Runtime version is installed automatically when you install Visual FoxPro unless you explicitly include it as part of a custom installation.

Requirements for Automation Servers

If you intend to use Visual FoxPro to create an Automation server, you must have the Visual FoxPro Runtime installed. The Runtime version is installed automatically when you install Visual FoxPro unless you explicitly include it as part of a custom installation.

Requirements for the Upsizing Wizards

The Upsizing Wizards take a Visual FoxPro database and create SQL or Oracle databases on a server with the same table structures, data, and many other attributes of the original Visual FoxPro database. The Upsizing Wizards have the following server, client, and network requirements.

Server You need one of the following products:

Client The client machine must:

Network The client and server machines must be networked with one of the following products:

Installing Visual FoxPro

The following sections provide information about installing the Visual FoxPro program, and some important notes about installing the Windows NT Service Pack.

Installing Visual FoxPro 5.0

You can install Visual FoxPro from CD-ROM or a network; 3.5 floppy disks are available by fulfillment only.

Important

If you use a virus protection program on your computer, override it or turn it off before you run the Setup program. Setup might not run properly with virus protection turned on. After running Setup, be sure to restart your virus protection program.

If you have already installed ODBC 3.0 before you install Visual FoxPro, select the Custom Install for Visual FoxPro and de-select the ODBC driver installation.

To install Visual FoxPro from CD-ROM

  1. Insert the CD into your CD-ROM drive.

  2. From the Start menu, choose Run.

  3. Type x:\setup, where x is the letter representing your CD-ROM drive, and press ENTER.

  4. Follow the instructions on the screen.
    • For a minimum installation (15 MB), choose Laptop. This option does not provide a Help file, sample files, or ODBC support.

    • For a typical installation (100 MB), choose Complete. This option leaves the online documentation content files on the CD.

    • To install all Visual FoxPro files (240 MB), including the online documentation content files, choose Custom and then choose Select All.

      Note   If you will be using the Setup Wizard or creating Automation servers using Visual FoxPro, you must install the Visual FoxPro Runtime. The Runtime version is installed automatically unless you choose a Custom installation and remove it as one of the choices under Professional Applications.

New Features in Visual FoxPro 5.0

This version of Visual FoxPro brings you expanded capabilities to help you in every area of application and database development. You can see improvements in performance, system resource use, and design environment. For information about changes to the language, see New Language Elements in the main Help file.

Visual FoxPro 5.0 includes the following new features:

Enhanced Project and Database Management

In this version, you have greater control over your projects and databases. You can use source code control products, such as Microsoft Visual SourceSafe™, and see the status of components in the Project Manager. The database container allows several users to simultaneously create and modify objects within the same database. An on-demand refresh feature lets you update your view of a database or project. Find and Arrange features in the Database Designer allow you to quickly change your view of the objects in your database. Also, keyboard accessibility is available in the Project Manager, and icons in the Project Manager and Database Designer help you to identify objects quickly.

The engine now supports changes to values that violate rules. Pessimistic buffering handles record locking more efficiently. NULL is now a recognized keyword and can be used in place of ".NULL."

Improved Debugging Tools

You can debug and monitor your application components more easily in this version of Visual FoxPro. You have the option to open the debugging tools inside the main Visual FoxPro window where they can be displayed along with your application interface, or in a separate window so they don't interfere with your application's work space. The new debugger offers tools for setting breakpoints, tracking events, and logging execution code, and is similar in appearance to the Visual C++® debugging environment. In the Watch window and the Locals window, you can drill down to see the property settings or objects and the values of array elements. To see the current value of a variable, you just place your cursor over the variable name in the Trace window. The Output window gives you a convenient way to display interactive or coded information requests and direct the results to a window apart from the application window.

Easier Table Design and Expanded Data Dictionary

In this version of the Table Designer, you can easily add indexes as you create fields and specify a greater variety of defaults that make designing forms faster and easier. You can define a regular index on the same tab and row that you specify a field. A Table tab gives you direct access to the table-level validation rules, triggers, and statistics. The new default class and library properties allow you to assign a control type to a field: when you add the field to a form, you create the exact control you want in one easy step. In addition, InputMask and Format properties help you control how your data is displayed.

A new Connection Designer works seamlessly with the ODBC Administrator to make connection creation easier. The designer also provides additional properties for optimizing connections.

Enhanced Query and View Design

You can now create outer joins, specify aliases for columns, or select the top number or percentage of records, right in the Query and View Designers. Also, using the View Designer, you can specify the same extended properties on view fields that you can on table fields. For example, you can specify a default control class, input mask, or format.

If you select records into a cursor, you can use the new NOFILTER keyword to create a physical file you can reference in subsequent queries. Previously, if the query had a filter, the cursor could not be referenced.

Increased Form Functionality and Easier Design

Along with enhancements to the data dictionary that help with form design, the Form Designer itself is easier to use and offers more functionality. The Form Designer supports Single Document Interface (SDI) as well as Multiple Document Interface (MDI) options so your application can function exactly the way you want. Using SDI, you can create application windows that are children of the Windows desktop. A new Shortcut Menu Designer helps you create shortcut menus you can use in a control's new RightClick event. Forms and controls have additional properties and methods to help you control the look and feel of each part of your form.

You can select a group of controls and see common properties, or change them, in the Properties window. If you need more space to view or alter property settings, you can use the Property Zoom feature. Horizontal and vertical centering, and other placement, is easy too, with the Alignment tools. Keyboard navigation in the Properties window lets you move from object to object using the CTRL key in conjunction with the PAGE UP, PAGE DOWN, HOME, or END keys. If you need to change something in a running form, the Design button on the toolbar gives you quick access to design mode again.

The new editor makes coding easier with options to format programs, color coding, and enhanced find and replace features. Shortcut menus and keyboard accessibility are available throughout the product: use the right mouse button to explore the actions possible for any given element.

More and Better Wizards

Two new wizards help you to create applications:

Updates to other wizards and samples give you added capabilities, such as accessing index tags for sorting. The Form Wizard allows you to add a page frame to display more fields on additional pages. The Pivot Table Wizard and Mail Merge Wizard now make use of the new Visual FoxPro Open Database Connectivity (ODBC) driver. The Upsizing Wizard supports declarative referential integrity. The Cross-Tab Wizard and Graph Wizard now support display and suppression of null values. In addition, the WWW Search Page Wizard, provided as a utility, lets you create Web pages for querying and displaying your database records.

Tighter OLE and ActiveX Integration

Visual FoxPro is now an OLE server, so other applications can tap into the power of Visual FoxPro. New containership (also known as ISimpleFrame) and data bound capabilities extend support for a wider variety of ActiveX controls. Visual FoxPro also provides the capability to create your own OLE servers (as both .exe and in-process .dll files) that you can deploy locally or remotely.

Improved Connectivity Using Offline Views

There are times when you might want to display, collect, or modify data independent of the host database. By creating offline views in Visual FoxPro, you can use views to connect to a host database and create a subset of data for use offline.

Working offline, you can use the view directly or through an application that you create. When you are done, you can upload the changes stored in the view back to the host database. When you upload the offline view, Visual FoxPro manages the task of coordinating the changes between the offline view and the original data.

Practical Samples of Application Components

The new Solutions sample is a collection of application components that show how you can use the features of Visual FoxPro to implement real-world database solutions. You can use the sample components and their code directly in your applications.

Using Visual FoxPro

The following topics concern information that was not available at the time the documentation was being finished. Click a topic name to jump directly to it, or scroll down to see them all in the following order:

Installation
Forms and Controls
Reports, Views, Queries, and SQL
Development Environment
Wizards
Class Browser
ActiveX Controls

Installation

Installing Controls Shared with Visual Basic

If you have an existing Visual FoxPro application that includes either the Treeview or the ImageList control, you can get an error after you install Visual Basic® 5.0. For example, the Class Browser and the Samples applications shipping with Visual FoxPro 5.0 use these controls. To run these types of applications without error, uninstall the new Treeview and Imagelist controls (Comctl32.ocx) shipped with Visual Basic 5.0 and reinstall the version shipped with Visual FoxPro 5.0 or Visual Basic 4.0a.

Updating a Visual FoxPro 3.0 Configuration File

If you install Visual FoxPro version 5.0 into the existing Visual FoxPro 3.0 directory, the new version of Visual FoxPro will read and use the configuration file (Config.fpw) if it exists.

If your program does use the old configuration file, you might want to update it; in Visual FoxPro version 5.0 it is no longer necessary to call the startup program VfpStart.prg from a configuration file. Open your Config.fpw file and check for a line similar to the following:

command = DO HOME() + "vfpstart"

If you did not customize the VfpStart.prg program in Visual FoxPro version 3.0, you can simply remove this line from the Config.fpw file. If you did customize VfpStart.prg with changes that you want to retain and have called by Visual FoxPro version 5.0 at startup, leave the line as is.

Microsoft Graph VBA (Visual Basic for Applications) Help

When you install Visual FoxPro, you also install VBA_grp.hlp in the MSAPPS\MSGRAPH directory. This Help file is a reference guide describing the objects, properties, and methods provided by Microsoft Graph for creating applications using Automation.

Forms and Controls

Refreshing Form Display When Running Commands

If you run certain commands, specifically commands that perform record input or output (such as REINDEX), Visual FoxPro attempts to optimize the command by minimizing other activities while the command is running. One area affected by this optimization is screen display. As a result, you might experience a situation in which Visual FoxPro does not refresh the screen until after the command has finished.

For example, you might have a form that users see as a dialog box used to start a reindexing process. Because reindexing can potentially take a while, you might want to post a message with text such as "Please wait while the table is reindexed." The code for a Reindex button might be:

msg = "Please wait while the table is reindexed."
THISFORM.Label1.Caption = msg
REINDEX

When you click the button, you might see that the label caption does not appear until after the reindexing process has completed.

If this occurs, you can issue a WAIT command to delay the start of the command that takes priority, which allows Visual FoxPro the time to refresh the screen. If the input cursor appears in the wrong location, you can remove it by calling the Show method of the _SCREEN object. The following example shows how you can issue a WAIT command that does not post a window, and delays the start of the REINDEX command by .1 second:

Msg = "Please wait while the table is reindexed."
THISFORM.Label1.Caption = msg
_SCREEN.Show
WAIT "" TIMEOUT .1
REINDEX
 

Clearing Text Displayed With the @…SAY Command

If you display information in a form using the @…SAY command, you might find that you cannot clear the form by issuing the CLEAR command. For example, the Click method for a button named "Show Date" might be:

@ 10,20 SAY datetime()

The Click method for a button named "Clear Date" might then be:

CLEAR
THIS.Parent.Setall("VISIBLE", .T.)
THISFORM.Refresh

However, this method code will not actually clear the screen. You must lock the screen before refreshing it, then unlock it again afterward. The complete method code would therefore look like this:

CLEAR
THISFORM.LockScreen = .F.
THIS.Parent.Setall("VISIBLE", .T.)
THISFORM.LockScreen = .F.
THISFORM.Refresh

Creating Modal and Modeless SDI and MDI Forms

To create modal or modeless SDI and MDI forms, you must set three properties; the documentation discusses only two.

The following table illustrates the combination of form properties you set to arrive at different types of forms: modal and modeless forms, as both MDI and SDI windows. In the table, "Traditional" refers to an application like that created in Visual FoxPro 3.0, in which the Visual FoxPro main window serves as the desktop. In an MDI application, the form is a child window of a form called WindMain, which serves as the desktop. An SDI application features a floating form.

Property Settings for Creating SDI and MDI Forms

Application Style Modal form Modeless form Desktop
Traditional ShowWindow = 0
Desktop = .F.
WindowType = 1
ShowWindow = 0
Desktop = .F.
WindowType = 0
_SCREEN.Visible = .T.
 
(_SCREEN serves as the desktop.)
MDI ShowWindow = 1
Desktop = .F.
WindowType = 1
ShowWindow = 1
Desktop = .F.
WindowType = 0

_SCREEN.Visible = .F.
WindMain.ShowWindow = 2
WindMain.WindowType = 0

 
(The custom form, WindMain, serves as the desktop.)
SDI ShowWindow = 1
DeskTop = .T.
WindowType = 1
ShowWindow = 2
WindowType = 0
_SCREEN.Visible = .F.

(No desktop form; the Windows desktop is the desktop for the application.)

For example, to present a modal form in an SDI application, set the properties as follows

WindowType = 1 (Modal)
ShowWindow = 1 (In top-level form)
Desktop = .T.

In addition to setting the properties listed in the preceding table, you can set the MDIForm property to specify whether a maximized child form shares its title bar and toolbars with the parent window. For details, see "MDIForm Property" under "Changes to Documentation" later in this document.

Creating Instances of Top-Level Forms With No Title Bars

If you want to create a form with no title bar, you might have difficulty if you are doing so by creating it as an instance of a form class. Ordinarily, you would expect to create a top-level form with no title by setting:

For example, you would expect the following code to produce a form with no title bar:

PUBLIC myForm
myForm = CREATEOBJECT("blankForm")
myForm.Show
RETURN

DEFINE CLASS blankForm AS form
 ShowWindow = 2
 BorderStyle = 2
 Caption = ""
 ControlBox = .F.
 MaxButton = .F.
 MinButton = .F.
 Movable = .F.
ENDDEFINE

However, the form appears with an empty title bar. To work around this problem and produce a form with no title bar, you can initially set the Caption property to a string value, then reset it to an empty string in the form's Init method. The following code shows the modifications you can make to the previous example to display the form correctly:

PUBLIC myForm
myForm = CREATEOBJECT("blankForm")
myForm.Show
RETURN

DEFINE CLASS blankForm AS form
 ShowWindow = 2
 BorderStyle = 2
 Caption = "Testing form"
 ControlBox = .F.
 MaxButton = .F.
 MinButton = .F.
 Movable = .F.
 PROCEDURE Init
  THIS.Caption = ""
 ENDPROC
ENDDEFINE

Using the ActiveRow Property in Grids

The time required to get the value of a grid's ActiveRow property can vary according to where the request originates. If you get the property value from within the grid itself (THIS.ActiveRow), the time required to get the property value depends on where in the grid the active row is. The closer the active row is to the top of the grid, the less time it takes to get the value. However, if you get the property value from outside the grid (for example, getting THISFORM.Grid1.ActiveRow from a command button), the time required to get the property value is always the same, equivalent to getting the value when the active row is at the top of the grid.

Creating Custom Objects Containing Forms

Visual FoxPro does not allow you to create a form that contains a custom object that in turn contains another form. If you attempt to add a form object to another form in this way, Visual FoxPro reports an application error.

Reports, Views, Queries, and SQL

Icons in the Report Designer Picture Control

When you create picture controls in the Report Designer, icon (.ico) files are no longer offered as a default option in the Open dialog box used to choose a file. You can still include icons by specifying the full file name for the .ico file. The icon will appear in your report when you preview it, but will not print.

Creating Views with Large SQL Statements in the View Designer

If you create views that are based on large or complex SQL statements (such as a large number of Group By or Order By fields), the View Designer might report an error. If this occurs, simplify the view definition or split the view definition into multiple views.

Selecting Groups in Remote Views With the View Designer

A problem can occur if you are using the View Designer to create a remote view that groups data and includes a HAVING clause. In particular, the problem can occur if you follow these steps:

  1. Create a remote view using the View Designer.

  2. Specify a group in the Group by tab.

  3. Choose Having to create a HAVING clause.

  4. In the Having dialog box, choose Not in combination with any of these operators: Equal, Like, Is NULL, Between, In.

  5. Save your view and close the View Designer.

  6. Re-open the View Designer to modify the view.
When you first create the view, it will execute properly. However, when you open the view again to modify it, you might see a syntax error message displayed by the remote data source. If so, you can resolve the error by choosing the Group by tab, then choosing Having to open the Having dialog box. Then choose OK to close the Having dialog box and continue with any other modifications.

Creating Outer Joins in Remote Views Using the SQL Server

If you are using SQL Server ODBC driver version 6.5, you might experience a problem when you create a view that uses an outer join involving a table on the server. (The problem does not occur if you use version 6.0 of the SQL Server ODBC driver, or if you are using another data source.)

If you use a table alias in defining the join, or if you define the join using the Remote View Designer, the SQL Server ODBC driver will not accept the SQL statement. For example, the following SQL statement, though correct, will result in an error when the subsequent USE command is issued:

CREATE VIEW aView CONN aConn AS;
 SELECT *;
 FROM  {oj authors A LEFT OUTER JOIN titleauthor T;
 ON A.au_id = T.au_id}

USE aView

You can work around this problem in two ways. The first is to avoid using table aliases in the view definition. For example, you could get the same results as the example above using these statements:

CREATE VIEW aView CONN aConn AS;
 SELECT *;
   FROM  {oj authors LEFT OUTER JOIN titleauthor;
  ON authors.au_id = titleauthor.au_id}
USE aView

Alternatively, you can create the statement using native SQL Server syntax for outer joins (*= for a left outer join, =* for a right outer join). For example, the following statements illustrate a self-join using native SQL Server syntax:

CREATE VIEW aView CONN aConn AS;
 SELECT *;
  FROM  Employee A, Employee B;
  WHERE A.Emp_ID *= B.Supv_ID
USE aView

The Remote View Designer generates SQL statements using table aliases. Therefore, you cannot use the Remote View Designer to implement either of these solutions.

Development Environment

Updating Values in the Debugger Windows

If you issue the command SET TRBETWEEN OFF, the Debugger ordinarily updates the values in its window (Trace window, Watch window, Locals window, and so on) only when Visual FoxPro reaches a wait state. However, the Debugger might also update the values in the window at other times, for example, when the Debugger redisplays its windows, as might happen if the window has been temporarily covered by another program's window. This can result in new values appearing in the Debugger windows at unexpected times.

Using CREATEOBJECT( ) in the Watch Window

You should not attempt to use the CREATEOBJECT( ) function in an expression that you enter in the Watch window. If you do, Visual FoxPro will display an error indicating that the expression cannot be evaluated. As part of its expression evaluation, Visual FoxPro will create and dispose of the object. If the object specified in CREATEOBJECT( ) is an Automation object, you might launch multiple instances of the object, which can cause you to run out of memory.

Debugger Locals Window

The documentation for variable categories in the Locals window does not explicitly state that hidden and protected variables are not visible in this window.

Choosing Step Out in the Debugger Toolbar

Before choosing the Step Out button on the Debugger tool bar, make sure the Trace window is open. If the Trace window is closed, the button does not function.

Using Source Control Software

When working with source control software in Visual FoxPro, be sure that you and other developers are doing the following:

If your team does not follow these guidelines, you can experience problems when checking in forms or other types of binary files. In some cases, the source control software might also delete the local version of these files from your machine.

Wizards

Using the World-Wide Web Search Page Wizard

The WWW Search Page Wizard allows you to create Web pages that can perform a search against Visual FoxPro data. However, you should be aware that this is an unsupported wizard. (The files for this wizard are located in the Visual FoxPro TOOLS\INETWIZ directory.)

You can either use the Visual FoxPro Server application (Server.app) as your Web server, or you can use the Visual FoxPro ODBC driver in conjunction with the httpodbc.dll engine that ships with Microsoft Internet Information Server (IIS). For more information about using httpodbc.dll, see the IIS documentation.

As an alternative to creating a search page using WWW Search Page Wizard, you can use ISAPI (Internet Server API) protocol in conjunction with Custom OLE Servers created with Visual FoxPro 5.0. For an example, see FoxISAPI.dll in the in the Visual FoxPro API\SAMPLES\SERVERS directory. Refer to the readme.txt file in that directory for details about how to run the example.

Using the Oracle Upsizing Wizard

The Visigenics ODBC driver for Oracle does not work properly with Windows 95.

Class Browser

The following features have been added to the Visual FoxPro Class Browser. For information about running and customizing the Visual FoxPro Class Browser, search for "Class Browser" in Help.

Reopening Files

You can right-click the Open and Add buttons to display a list of the last eight files that were opened in the Class Browser and that are not currently displayed in the active Class Browser window. Choose the desired class from the list to reopen it.

Specifying a Default File to Open

By default, when you run the Class Browser from the Tools menu or from the Command window, the Open dialog box is displayed so you can choose a file to open. You can also specify one or more default files to be opened when you run the Class Browser.

To specify a default Class Browser file

  1. Open the file in the Class Browser.

  2. Make sure the file is selected in the Class list of the Class Browser.

  3. In the Command window, enter the following line of code:

    
     _oBrowser.SetDefaultFile
    
Any default files previously specified are no longer opened by default. Instead of overwriting the default file, you can add to a default file list.

To specify additional default Class Browser files

  1. Open the additional file in the Class Browser.

  2. Make sure the file is selected in the Class list of the Class Browser.

  3. In the Command window, enter the following line of code:

    
     _oBrowser.SetDefaultFile(.T.)
    
To remove a default file from the Class Browser list
  1. Make sure the file is selected in the Class list of the Class Browser.

  2. In the Command window, enter the following line of code:

    
     _oBrowser.ResetDefaultFile
    
To remove all default files from the Class Browser list Setting OLE Public

If a class is defined as OLE Public, an asterisk (*) is displayed beside the class name in the Class list. To change the OLE Public state of a class, choose OLE Public from the shortcut menu.

In conjunction with this new feature, the aClassList array property now has an additional column:

aClassList position Setting
[nIndex,9] If true (.T.), the class is defined as OLE Public.

Exporting Class Code to a File

In addition to viewing class definition code in a window, you can save it directly to a file.

To save class definition code to a file

  1. Choose Export from the shortcut menu.

    - or -

    Right-click the View Class Code button.

  2. Select or enter the file name in the Open dialog box.

In conjunction with this new feature, a second parameter has been added to the ExportClass method for the file name. The syntax is now:


 ExportClass([lShow][, tcExportToFileName])
Dragging and Dropping the Class Icon

You can create instances of classes by dragging the class icon from the Class Browser to the desktop. Now you can suppress error messages generated when creating instances by holding the CTRL key down during the drag and drop operation. You can also drop the class icon on the Command window to execute the appropriate SET CLASSLIB command and the CREATEOBJECT code to instantiate the class.

Note Because the Class Browser merely creates an instance of the selected class, it cannot determine in advance possible dependencies that might arise from the Init, Load, or Activate events for that object. It is highly recommended that you be familiar with the code in the constructor events of a class before using this feature.

In conjunction with this new feature, you can pass the following oObject parameters to the FormAddObject method: command, _screen, or new.

_obrowser.FormAddObject ("command")
_obrowser.FormAddObject ("_screen")
_obrowser.FormAddObject ("new")
 

An optional parameter, tlNoErrors, has been added to the FormAddObject method. The syntax is now:

 FormAddObject(oObject [, nXCoord] [, nYCoord] [, lActivateForm] 
[, lDesignMode][, lNoShow][, tlNoErrors])
 

ActiveX Controls

Support for ActiveX Controls

Because ActiveX controls are independent modules, not developed in or specifically for Visual FoxPro, they might exhibit behavior different than that of native Visual FoxPro controls. You might also experience problems when using them in Visual FoxPro or find that they work differently than they do in other programs.

For example, Visual FoxPro treats ISimpleFrame controls as true containers. Visual FoxPro also supports the ability to subclass ActiveX controls. Both of these features affect the language used when working with ActiveX controls; some of the samples that you find in the control's documentation might need to be modified to work correctly in Visual FoxPro.

If you are experiencing a problem with a control, you might find that a workaround or a more recent version of the control is available. For the most up-to-date information, search the Visual FoxPro Knowledge Base using the keyword "ActiveX." The knowledge base contains sample code, version information, and known issues concerning ActiveX controls.

Disabling or Enabling VTABLE Binding

Some ActiveX controls are documented to support VTABLE binding but do not fully do so. VTABLE binding allows the control's host to bind "early" to its members (properties and methods) for better performance. If the control does not support VTABLE binding, Visual FoxPro might experience a fatal error in the module Oleaut32.dll, or you might see a message such as "Not enough storage space is available to complete this operation."

If so, you can temporarily disable VTABLE binding by calling the new SYS(2333) function. The syntax is:

SYS(2333, 0)

After disabling VTABLE binding, you can create an instance of the control. Then reset VTABLE binding by calling SYS(2333,1) so that other ActiveX controls can take advantage of the speed increases offered by VTABLE binding.

Note If you are testing ActiveX controls in Visual Basic 4.0, you will not encounter this problem, because that version of Visual Basic does not support VTABLE binding.

You can also create an entry in the Windows Registry to disable VTABLE binding for individual controls, which saves you the trouble of disabling it each time you want to create another instance of the control. To do so, create an entry using the following Registry key, in which clsid represents the class id of the control for which you are disabling VTABLE binding:

HKEY_CLASSES_ROOT\NoDualInterface\{clsid}

For example, you can disable VTABLE binding for the Internet Explorer Shell control by making this entry in the Registry:

HKEY_CLASSES_ROOT\NoDualInterface\{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}

Automatically Resizing Panel Controls in Forms

If you add an ActiveX Threed Panel Control (as an OLE Container control) to a form, then set its AutoSize property to 2 - AutoSize Panel Height To Caption, you might experience problems in redrawing the control. The control might appear very thin, and might not allow you to reset its height. To correct this problem, reset its Caption property by double-clicking it in the Properties window. This causes the Caption property to be set to "(None)," and allows you to resize the panel as required.

Binding Rich Textbox Controls to Memo Fields

If you attempt to bind a Microsoft Rich Textbox control directly to a memo field in a table (by setting the control's ControlSource property to the name of the memo field), Visual FoxPro displays an error when you run the form, and unbinds the control. To work around this problem, you can copy the contents of the field to a variable that is updated whenever the record pointer is moved. Then bind the control to the variable instead of directly to the memo field. For an example of how to create this type of binding, see "Use the richtext control" in the Solutions Sample.

ToolTips for Controls Inside ISimpleFrame Controls

To display ToolTip text for a control inside an ISimpleFrame ActiveX control (for example, for a command button inside an ActiveX SSTab control) set the ShowTips property of the ActiveX control itself to true. For controls outside of ISimpleFrame ActiveX controls, set the the form's ShowTips property.

Getting Help for Controls Inside ISimpleFrame Controls

If you put a native Visual FoxPro control inside an ISimpleFrame control (for example, if you put a command button inside an ActiveX SSTab control), you cannot display context-sensitive Help (What's This Help) for that control.

Moving Between SSTab Control Tabs in Design Mode

If you create a form that contains an SSTab control, then run the form from the Form Designer, and then return to design mode, you might not be able to display the first tab in the control by clicking it. If this occurs, you can try clicking it several times, or you can click on the very edge of the tab.

Passing Arrays to ActiveX Controls

If you pass an array to an ActiveX control -- for example, if you call one of the control's methods and want to pass it an array -- you must pass the array by reference. If you pass the array by value (the default), only the first element will be passed.

Using ISimpleFrame Controls in Page Frames

You might experience the following problems when working with ISimpleFrame controls (such as a Threed Frame Control) in pages in a page frame:

Dragging and Dropping ActiveX Controls

You might not be able to establish drag and drop behavior for certain ActiveX controls. For example, you cannot drag ISimpleFrame controls. In other cases, you might find that establishing drag and drop between ActiveX controls results in an error.

Using Visual FoxPro Online Documentation

Visual FoxPro includes a complete documentation set online. The Online Documentation is a comprehensive resource for all your Visual FoxPro documentation needs, including procedural guides, reference material, information about sample applications and utilities, technical papers, and more.

The Online Documentation combines the benefits of print documentation and online Help, and offers further advantages as well. You can:

Accessing Online Documentation

Online Documenation is available from the Visual FoxPro Help menu.

To display Online Documentation

For details about how to use the Online Documentation browser, press F1 while in the browser.

Navigating in Online Documentation

You can navigate in the Online Documentation using a variety of methods.

To use the table of contents

  1. From the View menu, choose Contents.

    Note If no table of contents appears, your Online Documentation browser might be set to display only the topic text. From the View menu, choose Navigation & Topic.

  2. In the Contents area, choose the level (name of the book) that you want to display. You can open subsequent levels in the same way. To display a single topic, choose the page icon next to the name of the topic you want to see.

To find topics by keyword

  1. From the View menu, choose Index.

  2. In the box at the top of the Index area, enter the keyword to search for. Alternatively, you can browse the keywords in the list below the text box.

To find topics using full-text search

  1. From the View menu, choose Find.

  2. In the box at the top of the Find area, enter the word or phrase to search for. If you are entering a phrase, enclose it in quotation marks.
In the list below the text box, the browser displays a list of the topics containing the word or phrase you are looking for. Choose the name of a topic to navigate to it. When the browser displays the topic, it highlights all appearances of the word or phrase that you entered.

Tip You can refine your search using Boolean operators (AND and OR). For details, press F1 in the Find pane.

Viewing Multimedia Presentations

The Visual FoxPro Online Documentation contains a selection of multimedia presentations that illustrate how to use the program. For example, you can see an animated demonstration with narration that provides an overview of developing an application.

Multimedia presentations are associated with individual topics. If a topic contains a multimedia presentation, a video camera icon appears in the topic. Choose the icon to start the presentation.

Troubleshooting Online Documentation

If you experience problems when trying to use Online Documentation, the browser might not be able to find the text or multimedia files, or there might be a problem with your computer's current configuration. For details about configuration errors, see "Error Messages" below.

Cannot Display Text or Multimedia Presentations

Visual FoxPro uses the following Registry entry to store the location of the Online Documentation text database and multimedia files:

HKEY_CURRENT_USER\Software\VB and VBA Program Settings
   \MSeries\Visual FoxPro Online Documentation

 

If the browser cannot display text, check the value for Database Name in this Registry location, and make sure that the entry points to Vfpdocs.mdb, including the complete path. For example, the entry for Database Name might read:

C:\VFP\ONLINE\vfpdocs.mdb
 

If the browser cannot display multimedia presentations, check the path stored in the Media Path entry in the same Registry location. This entry should point to a directory where the Online Documentation .avi files are stored. (There is no file name in this entry, only a path.). Be sure that the path does not have a space in it.

Error Messages

Visual FoxPro might display an error message if there is a problem starting Online Documentation. The following table lists some error messages, their probable cause, and a proposed solution.

Error message Probable cause Solution
Cannot create auto-redraw image Low graphics memory Restart your computer.
Illegal procedure call Can't configure the browser according to its last position. Delete all lists in the browser list directory (usually VFP\ONLINE\LISTS) and restart the browser.

Changes to Documentation

The changes listed below are in addition to the documentation changes listed in online Help. To see those changes, search for "Changes to" in Help.

Developer's Guide

Chapter 12, "Adding Queries and Reports"

Page 341 In the paragraph under the heading "Setting Report Band Height," the last sentence should read:

For more information about Group bands, see the section "Grouping Data on Your Layout" in Chapter 7, "Designing Reports and Labels," in the User's Guide.

Page 342 In the last paragraph under the heading "Adding Field Controls," the last sentence should read:

After entering the expression, you can change the format or set printing, position, or stretch options. For more information, see "Adding a Comment to a Control" in Chapter 7, "Designing Reports and Labels" in the User's Guide, and "Setting a Control's Print Options" later in this chapter.

Chapter 16, "Adding OLE"

Page 445 Replace the following procedure step:

  1. Copy the OLE server executable file (.EXE) to the server and run it one time to register it in the Windows Registry.

With:

  1. Copy the OLE server executable file (.EXE) to the server and register it in the Windows Registry as described in the section "Registering an OLE Server" above.

Chapter 26, "Creating Distribution Disks"

Page 633 Under the heading "Selecting Optional Components," remove the last paragraph. The options to specify an operating system have been removed; you can use the Setup Wizard to create a single set of distribution disks for both Windows 95 and Windows NT.

Language Reference

_COVERAGE System Variable

Page 95 There is no default coverage application. This variable allows you to create your own coverage application and make it callable from Visual FoxPro.

ComboBox Control

Page 81 Add Picture to the list of properties supported by this control

GETOBJECT( ) Function

Page 204 In the syntax for this function, remove the square brackets that enclose the file name (which is not optional). The syntax should read:


 GETOBJECT(FileName [, ClassName])

HighlightRow Property

Page 216 This property specifies highlighting for individual cells, not for rows.

IMESTATUS( ) Function

Page 221 The table of the Korean locale return values in the IMESTATUS( ) topic contains incorrect values. The following table is correct:

Return Value IME Status
0 No IME installed.
1 Hangul mode (single-byte).
2 English mode (single-byte).
11 English mode (double-byte).
15 Hangul mode (double-byte).
23 Hanja conversion mode (Hangul + single-byte mode).
31 Hanja conversion mode (Hangul + double-byte mode).

PACK Command

Page 308 The PACK command now supports a TableName argument, allowing you to permanently remove all records marked for deletion in an unopened table. The new syntax is:


PACK [TableName] [MEMO] [DBF]

After all records marked for deletion are removed, the table stays closed. If the specified table is open, an error is generated.

Picture Property

Page 318 Add ComboBox to the list of controls to which this property applies.

SORT Command

Page 389 Remove references to the DATABASE and NAME clauses in the TOTAL command.

USE Command

Page 430 In the NOUPDATE clause for this command, it should note that if you first open a table using NOUPDATE, you cannot then open it in another work area as an updatable table. If you need to open the table for update, you must first close the command (using the CLOSE command or the USE command with no table name), then re-open it without the NOUPDATE clause.

SELECT - SQL Command

Page 372 The syntax for SELECT - SQL is incorrect. The correct syntax for SELECT - SQL can be found in Help.

SET( ) Function

Page 379 Under Arguments, the table of SET commands should include CARRY, which returns the values ON or OFF.

TopIndex Property

Page 422 This property is read-only for ComboBox controls (read/write for ListBox controls).

TopItemID Property

Page 422 This property is read-only for ComboBox controls (read/write for ListBox controls).

TOTAL Command

Page 422 Remove references to the DATABASE and NAME clauses in the TOTAL command.

Online Help

_RetDateStr( ) API Library Routine

The documentation for this function should note that when you pass a date, it must be in the form mm/dd/year; no other date formats (such as ANSI) are acceptable.

AERROR( ) Function

The first paragraph in the Remarks section states that this function creates an array with six columns. In fact, AERROR( ) creates an array with seven columns, as documented in the tables later in the Remarks section.

GotFocus Event

Remove the third paragraph of the Remarks section that states:

A form receives the focus only when the form has no controls or when all its controls are disabled or invisible.

MDIForm Property

The documentation incorrectly states that this property is included only for backward compatibility. The MDIForm property specifies whether a child form shares its title bar with the parent window when maximized. The settings for the MDIForm property are:

Setting Description
True (.T.) The title bar of a maximized child form is combined with the title bar of its parent, and its maximize button, minimize button, and close box are displayed in the menu bar, above any toolbars that are tiled to the top of the parent form.
False (.F.) A maximized child form retains its own title bar, which appears below any toolbars that are tiled to the top of the parent form.

SET DEBUG Command

SET DEBUG is ignored in Visual FoxPro 5.0.

SHOW WINDOW Command

The SCREEN clause should read as IN SCREEN.

Special Terms for Configuration Files

Term Description
HIDEAPPOBJ ON | OFF Specifies if the "VisualFoxPro.Application" object is available to other applications. Setting HIDEAPPOJ to ON prevents other applications such as Microsoft Visual Basic, Microsoft Visual C++, Visual FoxPro, and so on from accessing the application object of a Visual FoxPro custom server or a Visual FoxPro executable. This prevents other applications from accessing the main _VFP application object and from accessing any properties or methods of the Application property of any custom server objects. The default is OFF.

SYS(1271) Function

The documentation for SYS(1271) indicates that it can be used to return the name of the visual class library (.vcx file) in which a specified instance of an object is contained. In fact, SYS(1271) can only be used to return the name of a form (.scx file) in which an instance of a specified object is contained.

SYS(3054) Function

Under Arguments, add the following value:

11 Enables the display of Rushmore optimization levels for queries that involve joins or multiple tables.

You must call SYS(3054,11) to determine the optimization level for SELECT statement with a join. If you enable optimization display using SYS(3054,1), statements involving a join will be shown as not optimized, even if they are optimized.

SYS(3095) Function

Returns an IDispatch pointer for an OLE object.

Syntax
SYS(3095, oObjectName)

Returns
Numeric

Arguments
oObjectName Specifies the name of an OLE container control, an OLE bound control, or an application object for which SYS (3095) returns an IDispatch pointer. For example, issue ? SYS(3095, _VFP) to display the IDispatch pointer for the current instance of Visual FoxPro.

Remarks
SYS(3095) returns 0 if the object you specify is not an OLE object. For example, SYS(3095) returns 0 if you specify a Visual FoxPro form or native control for oObjectName. If the OLE object you specify doesn't exist, a "Variable is not found" error is generated.

Example
The following example displays the IDispatch pointer for a Microsoft Excel application object:

oExcelApp = CREATEOBJECT('Excel.Application')
* Display Idispatch pointer for Excel object
? SYS(3095, oExcelApp)